package com.creative.util;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.creative.accountsdk.holder.Constants;

/**
 * Created by wang_qian on 2015/11/27.
 */
public class FileUtils {

    /**
     * 优先用外部存储卡
     *
     * @param fileName 可以是文件名（tt.json）或者文件夹（ttt/）
     * @return
     */
    public static FileHandle getFileHandle(String fileName) {
        if (Gdx.files.isExternalStorageAvailable()) {
            return Gdx.files.external(fileName);
        }
        return   Gdx.files.local(fileName);
    }

    /**
     * 拍照FileHandle
     *
     * @return
     */
    public static FileHandle getCapture() {
        return  getFileHandle(Constants.ms_sp_wawayayareader+"/capture.jpg");
    }

}
